export default function loadBMap(ak) {
    return new Promise(function(resolve, reject) {
      if (typeof BMap !== 'undefined') {
        resolve(BMap)
        return true
      }
      window.initialize = function() {
        resolve(BMap)
      }
      let script = document.createElement('script')
      script.type = 'text/javascript'
      script.src = '//api.map.baidu.com/api?v=3.0&ak=OISYvc0uLC1ycaM9m26sgt7zvCzYbcUU&callback=initialize'
      script.onerror = reject
      document.head.appendChild(script)
    })
  }
  